package com.mobilebook.backend.action;

import java.io.PrintWriter;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.mobilebook.backend.commons.BaseAction;
import com.mobilebook.backend.objects.AdminUser;
import com.mobilebook.backend.objects.UserInfo;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class UserInfoAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = -945796122797024399L;
	public void index(){
		try {  
			String type = (String) super.getParameterValue("type");
            if(type != null){
            	AdminUser user = (AdminUser) super.getSessionValue("adminuser");
            	if(type.equals("info")){
	            	if(user == null){
	            		super.returnObject(new UserInfo(""));
	            	} else {
	            		super.returnObject(new UserInfo(user.getShowName()));
	            	}
	            	return;
            	}
            }
		}catch(Exception exp){
			
		}
	}
}
